PreviousNextTracker indexSee it online !

(106/308) 923 - GdbPlugin: breakpoints not found in shared libraries

I have some libraries linked with my application, which are built for debugging.

I can set breakpoints in them manually from gdb by
break inputfields.cpp:115
break inputfields.cpp:108

\[Switching to Thread 0xb695f6c0 (LWP 25626)\]
0xb7542d8e in __read_nocancel () from /lib/libpthread.so.0
Breakpoint 1 at 0xb7ed8a07: file inputfields.cpp, line 115.
Breakpoint 2 at 0xb7ed8b2f: file inputfields.cpp, line 108.
Qt: gdb: -nograb added to command-line options.

But if I set the same breakpoints from the GdbPlugin, it uses absolute path which is "too much information", I suppose.

(gdb)
>>> CommandManager: -break-insert /home/ezust/public_html/oopdocbook/docs/src/libs/forms/inputfields.cpp:115
&"No source file named /home/ezust/public_html/oopdocbook/docs/src/libs/forms/inputfields.cpp.\n"
^error,msg="No source file named /home/ezust/public_html/oopdocbook/docs/src/libs/forms/inputfields.cpp."
(gdb)
>>> CommandManager: -break-insert /home/ezust/public_html/oopdocbook/docs/src/libs/forms/inputfields.cpp:108
&"No source file named /home/ezust/public_html/oopdocbook/docs/src/libs/forms/inputfields.cpp.\n"
^error,msg="No source file named /home/ezust/public_html/oopdocbook/docs/src/libs/forms/inputfields.cpp."
(gdb)
>>> CommandManager: -exec-run
^running

perhaps an option to use only filenames instead of full paths when setting breakpoints?

Submitted ezust - 2007-11-08 05:47:36 Assigned
Priority 5 Labels
Status open Group None
Resolution None

Comments

2007-11-08 16:34:36
ezust

- **summary**: GdbPlugin: breakpoints not found with absolute paths --> GdbPlugin: breakpoints not found in shared libraries

2007-11-08 16:34:36
ezust

Logged In: YES
user_id=935841
Originator: YES

Actually, this may not be an absolute - vs - relative problem.
When I run gdb from the command line, I actually have a .gdbinit that looks like this:

file mmjbamarok
break main
r
break inputfields.cpp:104
break inputfields.cpp:115
break inputfields.cpp:108
c

I have to put a breakpoint in main, and run it, before I can set the breakpoints in the other source files.
Why? Because they are from shared libraries, which are not loaded until after main is reached. Therefore, I am unable to set the breakpoints in libraries until after it's started, loaded the libraries, and stopped again.

It would be nice if there was a way to run gdbplugin the same way.

2007-11-08 16:34:50
ezust

Logged In: YES
user_id=935841
Originator: YES

Actually, this may not be an absolute - vs - relative problem.
When I run gdb from the command line, I actually have a .gdbinit that looks like this:

file mmjbamarok
break main
r
break inputfields.cpp:104
break inputfields.cpp:115
break inputfields.cpp:108
c

I have to put a breakpoint in main, and run it, before I can set the breakpoints in the other source files.
Why? Because they are from shared libraries, which are not loaded until after main is reached. Therefore, I am unable to set the breakpoints in libraries until after it's started, loaded the libraries, and stopped again.

It would be nice if there was a way to run gdbplugin the same way.

2007-11-12 07:07:04
*anonymous

Logged In: YES
user_id=1477607
Originator: NO

Do you mean that .gdbinit is ignored when you use GdbPlugin to debug your application?

2007-11-16 21:36:37
ezust

Logged In: YES
user_id=935841
Originator: YES

it seems to be used now, although it's executing the commands in .gdbinit before the actual runtime is ready for them, so for example, using the same example I described below, the breakpoint at main is set, and then the "r" is executed, and then the "break" statements are sent to the gdb/mi process before it has reached the main breakpoint and has loaded the dynamic librarires, so that the later breakpoint are not set properly.

I'm trying to figure out how to list breakpoints that are currently known by gdb/mi. Is there a command line command to do it? help breakpoints shows me a lot of things but not how to list them.

2007-11-16 21:36:50
ezust

Logged In: YES
user_id=935841
Originator: YES

it seems to be used now, although it's executing the commands in .gdbinit before the actual runtime is ready for them, so for example, using the same example I described below, the breakpoint at main is set, and then the "r" is executed, and then the "break" statements are sent to the gdb/mi process before it has reached the main breakpoint and has loaded the dynamic librarires, so that the later breakpoint are not set properly.

I'm trying to figure out how to list breakpoints that are currently known by gdb/mi. Is there a command line command to do it? help breakpoints shows me a lot of things but not how to list them.

2007-11-17 10:04:49
*anonymous

Logged In: YES
user_id=1477607
Originator: NO

To list the breakpoints in gdb/mi, either use:
1. -break-list
2. Use the "GDB Breakpoints (View only)" menu item from the GdbPlugin menu

2010-06-15 18:33:14
*anonymous

Unassigning myself, as I no longer maintain the plugin.

2010-06-15 18:33:14
*anonymous

- **assigned_to**: shlomy --> nobody

2011-12-05 01:10:11
ezust

- **assigned_to**: nobody --> shlomy

2011-12-08 20:32:08
*anonymous

Unassigning myself since I no longer maintain the plugin.

2011-12-08 20:32:08
*anonymous

- **assigned_to**: shlomy --> nobody